home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Aminet 4
/
Aminet 4 - November 1994.iso
/
aminet
/
dev
/
obero
/
oberon_lib.lha
/
oberon-a
/
source1.lha
/
source
/
Amiga
/
InputEvent.mod
< prev
next >
Wrap
Text File
|
1994-08-08
|
11KB
|
304 lines
(**************************************************************************
$RCSfile: InputEvent.mod $
Description: input event definitions
Created by: fjc (Frank Copeland)
$Revision: 3.2 $
$Author: fjc $
$Date: 1994/08/08 00:53:42 $
$VER: inputevent.h 36.10 (26.6.92)
Includes Release 40.15
(C) Copyright 1985-1993 Commodore-Amiga, Inc.
All Rights Reserved
Oberon-A interface Copyright © 1994, Frank Copeland.
This file is part of the Oberon-A Interface.
See Oberon-A.doc for conditions of use and distribution.
***************************************************************************)
MODULE InputEvent;
(*
** $C- CaseChk $I- IndexChk $L+ LongAdr $N- NilChk
** $P- PortableCode $R- RangeChk $S- StackChk $T- TypeChk
** $V- OvflChk $Z- ZeroVars
*)
IMPORT E := Exec, U := Utility, T := Timer;
(* ----- constants --------------------------------------------------*)
CONST
(* --- InputEvent.ieClass --- *)
(* A NOP input event *)
classNull * = 00H;
(* A raw keycode from the keyboard device *)
classRawKey * = 01H;
(* The raw mouse report from the game port device *)
classRawMouse * = 02H;
(* A private console event *)
classEvent * = 03H;
(* A Pointer Position report *)
classPointerPos * = 04H;
(* A timer event *)
classTimer * = 06H;
(* select button pressed down over a Gadget (address in ieEventAddress) *)
classGadgetDown * = 07H;
(* select button released over the same Gadget (address in ieEventAddress) *)
classGadgetUp * = 08H;
(* some Requester activity has taken place. See Codes REQCLEAR and REQSET *)
classRequester * = 09H;
(* this is a Menu Number transmission (Menu number is in ieCode) *)
classMenuList * = 0AH;
(* User has selected the active Window's Close Gadget *)
classCloseWindow * = 0BH;
(* this Window has a new size *)
classSizeWindow * = 0CH;
(* the Window pointed to by ieEventAddress needs to be refreshed *)
classRefreshWindow * = 0DH;
(* new preferences are available *)
classNewPrefs * = 0EH;
(* the disk has been removed *)
classDiskRemoved * = 0FH;
(* the disk has been inserted *)
classDiskInserted * = 10H;
(* the window is about to be been made active *)
classActiveWindow * = 11H;
(* the window is about to be made inactive *)
classInactiveWindow * = 12H;
(* extended-function pointer position report (V36) *)
classNewPointerPos * = 13H;
(* Help key report during Menu session (V36) *)
classMenuHelp * = 14H;
(* the Window has been modified with move, size, zoom, or change (V36) *)
classChangeWindow * = 15H;
(* the last class *)
classMax * = 15H;
(* --- InputEvent.ieSubClass --- *)
(* NewPointerPos *)
(* like PointerPos *)
subClassCompatible * = 00H;
(* InputEvent.eventAddress points to PointerPixel) *)
subClassPixel * = 01H;
(* InputEvent.eventAddress points to PointerTablet) *)
subClassTablet * = 02H;
(* InputEvent.eventAddress points to NewTablet *)
subClassNewTablet * = 03H;
TYPE
IEDummyPtr * = CPOINTER TO IEDummy;
IEDummy * = RECORD END;
(* pointed to by InputEvent.eventAddress for classNewPointerPos,
* and subClassPixel.
*
* You specify a screen and pixel coordinates in that screen
* at which you'd like the mouse to be positioned.
* Intuition will try to oblige, but there will be restrictions
* to positioning the pointer over offscreen pixels.
*
* qualRelativeMouse is supported for subClassPixel.
*)
PointerPixelPtr* = CPOINTER TO PointerPixel;
PointerPixel* = RECORD
screen* : E.APTR; (*Intuition.ScreenPtr*);
(* pointer to an open screen *)
position* : RECORD (* pixel coordinates in screen *)
x * :INTEGER;
y * :INTEGER;
END;
END; (* PointerPixel *)
(* pointed to by InputEvent.eventAddress for classNewPointerPos,
* and subClassTablet.
*
* You specify a range of values and a value within the range
* independently for each of X and Y (the minimum value of
* the ranges is always normalized to 0).
*
* Intuition will position the mouse proportionally within its
* natural mouse position rectangle limits.
*
* qualRelativeMouse is not supported for subClassTablet.
*)
PointerTabletPtr* = CPOINTER TO PointerTablet;
PointerTablet* = RECORD
range * : RECORD (* 0 is min, these are max *)
x * : E.UWORD;
y * : E.UWORD;
END;
value * : RECORD (* between 0 and Range *)
x * : E.UWORD;
y * : E.UWORD;
END;
pressure * :INTEGER; (* -128 to 127 (unused, set to 0) *)
END; (* PointerTablet *)
(* The InputEvent.eventAddress of an classNewPointerPos event of subclass
* subClassNewTablet points at a NewTablet structure.
*
*
* qualRelativeMouse is not supported for subClassNewTablet.
*)
NewTabletPtr * = CPOINTER TO NewTablet;
NewTablet * = RECORD
(* Pointer to a hook you wish to be called back through, in
* order to handle scaling. You will be provided with the
* width and height you are expected to scale your tablet
* to, perhaps based on some user preferences.
* If NULL, the tablet's specified range will be mapped directly
* to that width and height for you, and you will not be
* called back.
*)
callBack * : U.HookPtr;
(* Post-scaling coordinates and fractional coordinates.
* DO NOT FILL THESE IN AT THE TIME THE EVENT IS WRITTEN!
* Your driver will be called back and provided information
* about the width and height of the area to scale the
* tablet into. It should scale the tablet coordinates
* (perhaps based on some preferences controlling aspect
* ratio, etc.) and place the scaled result into these
* fields. The ient_ScaledX and ient_ScaledY fields are
* in screen-pixel resolution, but the origin ( [0,0]-point )
* is not defined. The ient_ScaledXFraction and
* ient_ScaledYFraction fields represent sub-pixel position
* information, and should be scaled to fill a UWORD fraction.
*)
scaledX *, scaledY * : E.UWORD;
scaledXFraction *, scaledYFraction * : E.UWORD;
(* Current tablet coordinates along each axis: *)
tabletX *, tabletY * : E.ULONG;
(* Tablet range along each axis. For example, if ient_TabletX
* can take values 0-999, ient_RangeX should be 1000.
*)
rangeX *, rangeY * : E.ULONG;
(* Pointer to tag-list of additional tablet attributes.
* See <intuition/intuition.h> for the tag values.
*)
tagList * : U.TagListPtr;
END;
CONST
(* --- InputEvent.ieCode --- *)
(* rawKey *)
codeUpPrefix * = 80H;
codeKeyCodeFirst * = 00H;
codeKeyCodeLast * = 77H;
codeCommCodeFirst * = 78H;
codeCommCodeLast * = 7FH;
(* ANSI *)
codeC0First * = 00H;
codeC0Last * = 1FH;
codeAsciiFirst * = 20H;
codeAsciiLast * = 7EH;
codeAsciiDel * = 7FH;
codeC1First * = 80H;
codeC1Last * = 9FH;
codeLatin1First * = 0A0H;
codeLatin1Last * = 0FFH;
(* RawMouse *)
codeLButton * = 68H; (* also uses UpPREFIX *)
codeRButton * = 69H;
codeMButton * = 6AH;
codeNoButton * = 0FFH;
(* Event (V36) *)
codeNewActive * = 01H; (* new active input window *)
codeNewSize * = 02H; (* resize of window *)
codeRefresh * = 03H; (* refresh of window *)
(* Requester *)
(* broadcast when the first Requester (not subsequent ones) opens up in *)
(* the Window *)
codeReqSet * = 01H;
(* broadcast when the last Requester clears out of the Window *)
codeReqClear * = 00H;
(* --- InputEvent.ieQualifier --- *)
qualLShift * = 0;
qualRShift * = 1;
qualCapsLock * = 2;
qualControl * = 3;
qualLAlt * = 4;
qualRAlt * = 5;
qualLCommand * = 6;
qualRCommand * = 7;
qualNumericPad * = 8;
qualRepeat * = 9;
qualInterrupt * = 10;
qualMultiBroadcast * = 11;
qualMidButton * = 12;
qualRightButton * = 13;
qualLeftButton * = 14;
qualRelativeMouse * = 15;
(* ----- InputEvent -------------------------------------------------*)
TYPE
InputEventBasePtr* = CPOINTER TO InputEventBase;
InputEventBase* = RECORD END;
InputEventPtr* = CPOINTER TO InputEvent;
InputEvent* = RECORD (InputEventBase)
nextEvent* : InputEventBasePtr; (* the chronologically next event *)
class * : E.UBYTE; (* the input event class *)
subClass * : E.UBYTE; (* optional subclass of the class *)
code * : E.UWORD; (* the input event code *)
qualifier* : E.WSET; (* qualifiers in effect for the event*)
x * : INTEGER; (* the pointer position for the event*)
y * : INTEGER;
timeStamp * : T.TimeVal; (* the system tick at the event *)
END; (* InputEvent *)
InputEventAdrPtr* = CPOINTER TO InputEventAdr;
InputEventAdr* = RECORD (InputEventBase)
nextEvent* : InputEventBasePtr; (* the chronologically next event *)
class * : E.UBYTE; (* the input event class *)
subClass * : E.UBYTE; (* optional subclass of the class *)
code * : E.UWORD; (* the input event code *)
qualifier* : E.WSET; (* qualifiers in effect for the event*)
addr * : IEDummyPtr; (* the event address *)
TimeStamp * : T.TimeVal; (* the system tick at the event *)
END; (* InputEventAdr *)
InputEventPrevPtr* = CPOINTER TO InputEventPrev;
InputEventPrev* = RECORD (InputEventBase)
nextEvent* : InputEventBasePtr; (* the chronologically next event *)
class * : E.UBYTE; (* the input event class *)
subClass * : E.UBYTE; (* optional subclass of the class *)
code * : E.UWORD; (* the input event code *)
qualifier* : E.WSET; (* qualifiers in effect for the event*)
prev1DownCode * : E.UBYTE; (* previous down keys for dead *)
prev1DownQual * : E.BSET; (* key translation: the ieCode *)
prev2DownCode * : E.UBYTE; (* & low byte of ieQualifier for *)
prev2DownQual * : E.BSET; (* last & second last down keys *)
timeStamp * : T.TimeVal; (* the system tick at the event *)
END; (* InputEventPrev *)
END InputEvent.